------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:/Users/silvio/Documents/CVR/ryp/output/s1_mult_impu.log
  log type:  text
 opened on:   4 Jul 2018, 12:53:38

. clear

. 
. set more off

. use "${data}/cvrextrapo", clear

. set matsize 1392

. 
. scalar nstrata=58

. set seed 1234

. 
. matrix y=J(nstrata*3*8,4,0)

. scalar ij=1

. 
. local i=1

. while `i'<=nstrata{
  2. 
. scalar perpeh=1
  3. while perpeh<=3{
  4. local j=1
  5. while `j'<=8{
  6. matrix y[ij,1]=ij
  7. matrix y[ij,2]=perpeh
  8. matrix y[ij,3]=`j'
  9. matrix y[ij,4]=`i'
 10. scalar ij=ij+1
 11. local j=`j'+1
 12. }
 13. scalar perpeh=perpeh+1
 14. }
 15. local i=`i'+1
 16. }

. 
. matrix ymix=y

. matrix mfour=J(nstrata,1,-4)

. 
. 
. 
. 
. gen miss1=1-miss
(1173 missing values generated)

. gen ones=1

. 
. mlogit perpe2 sexon situa anohechos age cvr odh dp ones, noconst base(3)

Iteration 0:   log likelihood = -16579.158  
Iteration 1:   log likelihood = -8828.4674  
Iteration 2:   log likelihood = -8314.3968  
Iteration 3:   log likelihood = -8242.9485  
Iteration 4:   log likelihood = -8227.3258  
Iteration 5:   log likelihood =  -8226.955  
Iteration 6:   log likelihood = -8226.9547  

Multinomial logistic regression                   Number of obs   =      15091
                                                  Wald chi2(16)   =    6454.46
Log likelihood = -8226.9547                       Prob > chi2     =     0.0000

------------------------------------------------------------------------------
      perpe2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
1            |
       sexon |  -.0343932   .1555498    -0.22   0.825    -.3392652    .2704787
       situa |   .0045654   .1360464     0.03   0.973    -.2620807    .2712114
   anohechos |  -.1332044   .0155624    -8.56   0.000    -.1637061   -.1027028
         age |  -.0037422    .004036    -0.93   0.354    -.0116527    .0041683
         cvr |   .4066864   .2266507     1.79   0.073    -.0375409    .8509137
         odh |   1.005911   .2084556     4.83   0.000     .5973451    1.414476
          dp |   1.440492   .2155035     6.68   0.000     1.018113    1.862871
        ones |   267.2974   30.96449     8.63   0.000     206.6081    327.9867
-------------+----------------------------------------------------------------
2            |
       sexon |  -.0178314   .1551359    -0.11   0.908    -.3218922    .2862294
       situa |   .9133001   .1370355     6.66   0.000     .6447155    1.181885
   anohechos |  -.1345345   .0155616    -8.65   0.000    -.1650348   -.1040343
         age |   .0094035   .0040241     2.34   0.019     .0015163    .0172906
         cvr |   .6683755   .2473998     2.70   0.007     .1834808     1.15327
         odh |   -1.25414   .2235576    -5.61   0.000    -1.692305   -.8159754
          dp |  -1.590233   .2475415    -6.42   0.000    -2.075405    -1.10506
        ones |   269.4247   30.96285     8.70   0.000     208.7386    330.1108
-------------+----------------------------------------------------------------
3            |  (base outcome)
------------------------------------------------------------------------------

. mfx compute, predict(outcome(1))

Marginal effects after mlogit
      y  = Pr(perpe2==1) (predict, outcome(1))
         =  .60458673
------------------------------------------------------------------------------
variable |      dy/dx    Std. Err.     z    P>|z|  [    95% C.I.   ]      X
---------+--------------------------------------------------------------------
   sexon*|  -.0041953      .01241   -0.34   0.735  -.028515  .020124   .195812
   situa*|  -.1953971      .01055  -18.52   0.000  -.216079 -.174715   .647936
anohec~s |  -.0014184      .00023   -6.19   0.000  -.001868 -.000969   1987.19
     age |  -.0030213      .00032   -9.31   0.000  -.003657 -.002385   31.8045
     cvr*|  -.0511635      .02414   -2.12   0.034  -.098472 -.003855   .805314
     odh*|   .4284596      .01262   33.96   0.000    .40373  .453189    .28739
      dp*|   .4661791      .00847   55.01   0.000   .449569  .482789   .176728
    ones*|   .6045867      .00689   87.70   0.000   .591075  .618098         1
------------------------------------------------------------------------------
(*) dy/dx is for discrete change of dummy variable from 0 to 1

. mfx compute, predict(outcome(2))

Marginal effects after mlogit
      y  = Pr(perpe2==2) (predict, outcome(2))
         =  .37406502
------------------------------------------------------------------------------
variable |      dy/dx    Std. Err.     z    P>|z|  [    95% C.I.   ]      X
---------+--------------------------------------------------------------------
   sexon*|   .0036046      .01216    0.30   0.767   -.02022  .027429   .195812
   situa*|   .2024026      .01025   19.74   0.000   .182304  .222502   .647936
anohec~s |  -.0013752      .00018   -7.71   0.000  -.001725 -.001026   1987.19
     age |   .0030481      .00032    9.58   0.000   .002424  .003672   31.8045
     cvr*|   .0633936      .02463    2.57   0.010   .015117   .11167   .805314
     odh*|  -.4224475      .01258  -33.58   0.000  -.447103 -.397792    .28739
      dp*|  -.4546749      .00831  -54.74   0.000  -.470955 -.438395   .176728
    ones*|    .374065      .00697   53.69   0.000    .36041   .38772         1
------------------------------------------------------------------------------
(*) dy/dx is for discrete change of dummy variable from 0 to 1

. 
. matrix b=e(b)

. matrix V=e(V)

. matrix b=b[1,1..16]

. matrix V=V[1..16,1..16]

. matrix Z=J(1,16,0)

. 
. matrix C=cholesky(V)

. 
. mlogit perpe2 sexon situa anohechos cvr odh dp ones, noconst base(3)

Iteration 0:   log likelihood = -21694.297  
Iteration 1:   log likelihood = -11845.952  
Iteration 2:   log likelihood = -11189.839  
Iteration 3:   log likelihood = -11122.755  
Iteration 4:   log likelihood = -11111.924  
Iteration 5:   log likelihood = -11111.798  
Iteration 6:   log likelihood = -11111.798  

Multinomial logistic regression                   Number of obs   =      19747
                                                  Wald chi2(14)   =    8654.57
Log likelihood = -11111.798                       Prob > chi2     =     0.0000

------------------------------------------------------------------------------
      perpe2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
1            |
       sexon |   -.024595   .1215392    -0.20   0.840    -.2628075    .2136175
       situa |   .1467637   .1065985     1.38   0.169    -.0621656     .355693
   anohechos |  -.0814772   .0123895    -6.58   0.000    -.1057601   -.0571943
         cvr |   .6268688   .1540797     4.07   0.000     .3248782    .9288595
         odh |   .4692857   .1464343     3.20   0.001     .1822797    .7562916
          dp |   1.359725   .1442688     9.42   0.000     1.076964    1.642487
        ones |   164.0476   24.63766     6.66   0.000     115.7586    212.3365
-------------+----------------------------------------------------------------
2            |
       sexon |  -.0285328   .1230363    -0.23   0.817    -.2696794    .2126139
       situa |   1.206105   .1090829    11.06   0.000     .9923061    1.419903
   anohechos |  -.0829008   .0123919    -6.69   0.000    -.1071884   -.0586132
         cvr |   1.045522   .1798285     5.81   0.000     .6930642    1.397979
         odh |  -1.743766     .16567   -10.53   0.000    -2.068473   -1.419059
          dp |  -1.449049   .1771052    -8.18   0.000    -1.796169   -1.101929
        ones |   166.4229   24.64231     6.75   0.000     118.1249     214.721
-------------+----------------------------------------------------------------
3            |  (base outcome)
------------------------------------------------------------------------------

. mfx compute, predict(outcome(1))

Marginal effects after mlogit
      y  = Pr(perpe2==1) (predict, outcome(1))
         =  .63073765
------------------------------------------------------------------------------
variable |      dy/dx    Std. Err.     z    P>|z|  [    95% C.I.   ]      X
---------+--------------------------------------------------------------------
   sexon*|   .0004213      .01025    0.04   0.967  -.019677   .02052   .196334
   situa*|  -.2117543      .00885  -23.92   0.000  -.229102 -.194406   .630982
anohec~s |  -.0010975      .00024   -4.65   0.000   -.00156 -.000635   1986.74
     cvr*|  -.0715196      .02031   -3.52   0.000  -.111329  -.03171   .776979
     odh*|   .3896123      .01122   34.71   0.000   .367613  .411612   .278321
      dp*|   .4300577      .00772   55.69   0.000   .414921  .445194   .190966
    ones*|   .6307376      .00587  107.40   0.000   .619228  .642248         1
------------------------------------------------------------------------------
(*) dy/dx is for discrete change of dummy variable from 0 to 1

. mfx compute, predict(outcome(2))

Marginal effects after mlogit
      y  = Pr(perpe2==2) (predict, outcome(2))
         =  .34193304
------------------------------------------------------------------------------
variable |      dy/dx    Std. Err.     z    P>|z|  [    95% C.I.   ]      X
---------+--------------------------------------------------------------------
   sexon*|   -.001117      .01003   -0.11   0.911  -.020774   .01854   .196334
   situa*|   .2253412      .00852   26.45   0.000   .208641  .242042   .630982
anohec~s |  -.0010817      .00017   -6.51   0.000  -.001408 -.000756   1986.74
     cvr*|   .0966774      .02078    4.65   0.000   .055956  .137399   .776979
     odh*|  -.3926363      .01105  -35.54   0.000  -.414292 -.370981   .278321
      dp*|  -.4152052      .00764  -54.36   0.000  -.430176 -.400234   .190966
    ones*|    .341933      .00593   57.63   0.000   .330303  .353563         1
------------------------------------------------------------------------------
(*) dy/dx is for discrete change of dummy variable from 0 to 1

. 
. matrix ba=e(b)

. matrix Va=e(V)

. matrix ba=ba[1,1..14]

. matrix Va=Va[1..14,1..14]

. matrix Za=J(1,14,0)

. 
. matrix Ca=cholesky(Va)

. 
. matrix uno=J(1,1,0)

. matrix tres=J(3,1,0)

. 
. tab perpe2 if j~=.,matcell(k1)

     perpe2 |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |      9,566       50.33       50.33
          2 |      9,075       47.75       98.08
          3 |        365        1.92      100.00
------------+-----------------------------------
      Total |     19,006      100.00

. tab perpe2 source if j~=., matcell(k2)

           |                                    source
    perpe2 |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     3,734        959        551      1,561        620        966      1,175 |     9,566 
         2 |     8,607         34         59        247        105          1         22 |     9,075 
         3 |       270          1          2         52         12         27          1 |       365 
-----------+-----------------------------------------------------------------------------+----------
     Total |    12,611        994        612      1,860        737        994      1,198 |    19,006 


. matrix k1=uno,k1'

. matrix ktot=k1

. matrix k2=tres,k2

. matrix ktot2=k2

. 
. 
. 
. scalar mit=1

. while mit<=20{
  2. 
. 
. 
. gen exp1=exp(sexon*b[1,1]+situa*b[1,2]+anohechos*b[1,3]+age*b[1,4]+cvr*b[1,5]+odh*b[1,6]+ dp*b[1,7]+b[1,8])
  3.  gen exp2=exp(sexon*b[1,9]+situa*b[1,10]+anohechos*b[1,11]+age*b[1,12]+cvr*b[1,13]+odh*b[1,14]+ dp*b[1,15]+b[1,16])
  4.  gen pr1=exp1/(1+exp1+exp2)
  5.  gen pr2=exp2/(1+exp1+exp2)
  6.  gen pr3=1-pr1-pr2
  7. gen pr12=pr1+pr2
  8. gen perpred=3
  9. gen random=runiform()
 10. replace perpred=1 if random<=pr1
 11. replace perpred=2 if random>pr1 & random<=pr12
 12. replace perpred=perpe2 if miss1==1
 13. drop exp1 exp2 pr1 pr2 pr3 pr12 random
 14. 
. 
. gen exp1=exp(sexon*ba[1,1]+situa*ba[1,2]+anohechos*ba[1,3]+cvr*ba[1,4]+odh*ba[1,5]+ dp*ba[1,6]+ba[1,7])
 15.  gen exp2=exp(sexon*ba[1,8]+situa*ba[1,9]+anohechos*ba[1,10]+cvr*ba[1,11]+odh*ba[1,12]+ dp*ba[1,13]+ba[1,14])
 16.  gen pr1=exp1/(1+exp1+exp2)
 17.  gen pr2=exp2/(1+exp1+exp2)
 18.  gen pr3=1-pr1-pr2
 19. gen pr12=pr1+pr2
 20. gen perpreda=3
 21. gen random=runiform()
 22. replace perpreda=1 if random<=pr1
 23. replace perpreda=2 if random>pr1 & random<=pr12
 24. replace perpreda=perpe2 if miss1==1
 25. replace perpred=perpreda if perpreda~=. & perpred==.
 26. 
. drop perpreda
 27. 
. local i=1
 28. while `i'<=16 {
 29. matrix Z[1,`i']=invnorm(uniform())
 30. local i=`i'+1
 31. }
 32. local i=1
 33. while `i'<=14 {
 34. matrix Za[1,`i']=invnorm(uniform())
 35. local i=`i'+1
 36. }
 37. 
. *matrix u=matuniform(1,16)
. matrix b=b+Z*C'
 38. matrix ba=ba+Za*Ca'
 39. 
. scalar perpeh=1
 40. quietly: tab j source if perpred==perpeh, nol matcell(w) matrow(z)
 41. run "$code\reconv"
 42. matrix x1=x
 43. 
. scalar perpeh=2
 44. quietly: tab j source if perpred==perpeh, nol matcell(w) matrow(z)
 45.  run "$code\reconv"
 46. matrix x2=x
 47. 
. scalar perpeh=3
 48. quietly: tab j source if perpred==perpeh, nol matcell(w) matrow(z)
 49.  run "$code\reconv"
 50. matrix x3=x
 51. 
. 
. 
. 
. *log on
. di mit
 52. tab perpred if j~=.,matcell(k1)
 53. tab perpred source if j~=., matcell(k2)
 54. *log off
. matrix uno[1,1]=mit
 55. matrix tres[1,1]=mit
 56. matrix tres[2,1]=mit
 57. matrix tres[3,1]=mit
 58. matrix k1=uno,k1'
 59. matrix ktot=ktot \ k1
 60. matrix k2=tres,k2
 61. matrix ktot2=ktot2 \ k2
 62. 
. 
. 
. matrix dymi=x1,mfour,x2,mfour,x3,mfour
 63. matrix dymi=vec(dymi')
 64. 
. if mit==1{
 65. matrix ymi=dymi
 66. }
 67. else {
 68. matrix ymi=ymi,dymi
 69. }
 70. 
. drop exp1 exp2 pr1 pr2 pr3 pr12 perpred random 
 71. 
. di mit
 72. scalar mit=mit+1
 73. }
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16797 real changes made)
(8667 real changes made)
(7195 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14268 real changes made)
(11058 real changes made)
(6799 real changes made)
(0 real changes made)
1

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,287       53.16       53.16
          2 |     10,392       44.96       98.11
          3 |        436        1.89      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,903        987        559      1,876        639        977      1,181 |    11,122 
         2 |     9,898         34         59        271        107          1         22 |    10,392 
         3 |       321          1          2         71         13         27          1 |       436 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

1
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16727 real changes made)
(8706 real changes made)
(7063 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14544 real changes made)
(10748 real changes made)
(6754 real changes made)
(0 real changes made)
2

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,314       53.27       53.27
          2 |     10,360       44.82       98.09
          3 |        441        1.91      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,935        986        559      1,872        640        976      1,181 |    11,149 
         2 |     9,866         35         59        270        106          2         22 |    10,360 
         3 |       321          1          2         76         13         27          1 |       441 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

2
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16803 real changes made)
(8658 real changes made)
(7067 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14432 real changes made)
(10857 real changes made)
(6779 real changes made)
(0 real changes made)
3

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,284       53.14       53.14
          2 |     10,380       44.91       98.05
          3 |        451        1.95      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,906        986        558      1,873        638        977      1,181 |    11,119 
         2 |     9,883         35         60        270        109          1         22 |    10,380 
         3 |       333          1          2         75         12         27          1 |       451 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

3
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16709 real changes made)
(8803 real changes made)
(7053 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14398 real changes made)
(10840 real changes made)
(6818 real changes made)
(0 real changes made)
4

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,253       53.01       53.01
          2 |     10,431       45.13       98.14
          3 |        431        1.86      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,877        985        558      1,875        636        976      1,181 |    11,088 
         2 |     9,922         36         60        279        110          2         22 |    10,431 
         3 |       323          1          2         64         13         27          1 |       431 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

4
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16720 real changes made)
(8742 real changes made)
(7109 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14465 real changes made)
(10757 real changes made)
(6912 real changes made)
(0 real changes made)
5

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,283       53.14       53.14
          2 |     10,384       44.92       98.06
          3 |        448        1.94      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,918        987        557      1,860        638        977      1,181 |    11,118 
         2 |     9,886         34         61        272        108          1         22 |    10,384 
         3 |       318          1          2         86         13         27          1 |       448 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

5
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16708 real changes made)
(8751 real changes made)
(7067 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14376 real changes made)
(10856 real changes made)
(6844 real changes made)
(0 real changes made)
6

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,283       53.14       53.14
          2 |     10,390       44.95       98.09
          3 |        442        1.91      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,921        987        558      1,858        636        977      1,181 |    11,118 
         2 |     9,888         34         60        274        111          1         22 |    10,390 
         3 |       313          1          2         86         12         27          1 |       442 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

6
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16740 real changes made)
(8722 real changes made)
(7170 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14379 real changes made)
(10884 real changes made)
(6875 real changes made)
(0 real changes made)
7

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,318       53.29       53.29
          2 |     10,347       44.76       98.05
          3 |        450        1.95      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,954        986        558      1,862        636        976      1,181 |    11,153 
         2 |     9,847         34         60        273        110          1         22 |    10,347 
         3 |       321          2          2         83         13         28          1 |       450 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

7
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16822 real changes made)
(8591 real changes made)
(7191 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14453 real changes made)
(10829 real changes made)
(6918 real changes made)
(0 real changes made)
8

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,294       53.19       53.19
          2 |     10,363       44.83       98.02
          3 |        458        1.98      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,921        986        558      1,867        639        977      1,181 |    11,129 
         2 |     9,873         35         60        265        107          1         22 |    10,363 
         3 |       328          1          2         86         13         27          1 |       458 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

8
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16819 real changes made)
(8556 real changes made)
(7225 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14458 real changes made)
(10784 real changes made)
(6879 real changes made)
(0 real changes made)
9

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,308       53.25       53.25
          2 |     10,353       44.79       98.04
          3 |        454        1.96      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,942        987        559      1,862        635        977      1,181 |    11,143 
         2 |     9,853         34         59        275        109          1         22 |    10,353 
         3 |       327          1          2         81         15         27          1 |       454 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

9
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16803 real changes made)
(8673 real changes made)
(7110 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14481 real changes made)
(10795 real changes made)
(6933 real changes made)
(0 real changes made)
10

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,297       53.20       53.20
          2 |     10,374       44.88       98.08
          3 |        444        1.92      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,924        986        559      1,866        639        977      1,181 |    11,132 
         2 |     9,875         34         59        275        108          1         22 |    10,374 
         3 |       323          2          2         77         12         27          1 |       444 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

10
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16886 real changes made)
(8535 real changes made)
(7187 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14304 real changes made)
(10914 real changes made)
(6951 real changes made)
(0 real changes made)
11

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,301       53.22       53.22
          2 |     10,362       44.83       98.04
          3 |        452        1.96      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,929        987        559      1,872        631        977      1,181 |    11,136 
         2 |     9,868         34         59        265        113          1         22 |    10,362 
         3 |       325          1          2         81         15         27          1 |       452 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

11
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16996 real changes made)
(8418 real changes made)
(7214 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14391 real changes made)
(10875 real changes made)
(6932 real changes made)
(0 real changes made)
12

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,326       53.32       53.32
          2 |     10,322       44.65       97.98
          3 |        467        2.02      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,972        985        557      1,855        634        977      1,181 |    11,161 
         2 |     9,819         35         61        272        112          1         22 |    10,322 
         3 |       331          2          2         91         13         27          1 |       467 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

12
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16861 real changes made)
(8536 real changes made)
(7256 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14361 real changes made)
(10837 real changes made)
(7003 real changes made)
(0 real changes made)
13

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,318       53.29       53.29
          2 |     10,349       44.77       98.06
          3 |        448        1.94      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,955        987        559      1,856        638        977      1,181 |    11,153 
         2 |     9,846         34         59        278        109          1         22 |    10,349 
         3 |       321          1          2         84         12         27          1 |       448 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

13
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16936 real changes made)
(8386 real changes made)
(7253 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14350 real changes made)
(10859 real changes made)
(7046 real changes made)
(0 real changes made)
14

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,321       53.30       53.30
          2 |     10,362       44.83       98.13
          3 |        432        1.87      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,942        984        559      1,878        635        977      1,181 |    11,156 
         2 |     9,865         35         59        269        111          1         22 |    10,362 
         3 |       315          3          2         71         13         27          1 |       432 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

14
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(16910 real changes made)
(8377 real changes made)
(7318 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14341 real changes made)
(10847 real changes made)
(6980 real changes made)
(0 real changes made)
15

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,338       53.38       53.38
          2 |     10,338       44.72       98.10
          3 |        439        1.90      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,956        987        558      1,877        637        977      1,181 |    11,173 
         2 |     9,844         34         60        268        109          1         22 |    10,338 
         3 |       322          1          2         73         13         27          1 |       439 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

15
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(16867 real changes made)
(8477 real changes made)
(7371 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14374 real changes made)
(10780 real changes made)
(6933 real changes made)
(0 real changes made)
16

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,323       53.31       53.31
          2 |     10,338       44.72       98.04
          3 |        454        1.96      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,944        985        559      1,873        640        976      1,181 |    11,158 
         2 |     9,843         35         59        271        107          1         22 |    10,338 
         3 |       335          2          2         74         12         28          1 |       454 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

16
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(16838 real changes made)
(8452 real changes made)
(7327 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14368 real changes made)
(10774 real changes made)
(6974 real changes made)
(0 real changes made)
17

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,301       53.22       53.22
          2 |     10,358       44.81       98.03
          3 |        456        1.97      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,915        986        557      1,881        639        977      1,181 |    11,136 
         2 |     9,871         34         61        261        108          1         22 |    10,358 
         3 |       336          2          2         76         12         27          1 |       456 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

17
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(16805 real changes made)
(8563 real changes made)
(7244 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14503 real changes made)
(10697 real changes made)
(6987 real changes made)
(0 real changes made)
18

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,296       53.19       53.19
          2 |     10,378       44.90       98.09
          3 |        441        1.91      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,919        983        558      1,876        638        976      1,181 |    11,131 
         2 |     9,881         36         60        269        109          1         22 |    10,378 
         3 |       322          3          2         73         12         28          1 |       441 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

18
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(8361 missing values generated)
(16731 real changes made)
(8620 real changes made)
(7156 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14183 real changes made)
(10990 real changes made)
(6962 real changes made)
(0 real changes made)
19

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,317       53.29       53.29
          2 |     10,354       44.79       98.08
          3 |        444        1.92      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,936        984        557      1,877        640        977      1,181 |    11,152 
         2 |     9,856         36         61        272        106          1         22 |    10,354 
         3 |       330          2          2         69         13         27          1 |       444 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

19
(8361 missing values generated)
(8361 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(8364 missing values generated)
(16883 real changes made)
(8512 real changes made)
(7288 real changes made)
(2820 missing values generated)
(2820 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(2824 missing values generated)
(14305 real changes made)
(10889 real changes made)
(6933 real changes made)
(0 real changes made)
20

    perpred |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     12,329       53.34       53.34
          2 |     10,359       44.82       98.15
          3 |        427        1.85      100.00
------------+-----------------------------------
      Total |     23,115      100.00

           |                                    source
   perpred |         C          D         CD          N         CN         DN        CDN |     Total
-----------+-----------------------------------------------------------------------------+----------
         1 |     4,945        987        558      1,881        636        977      1,180 |    11,164 
         2 |     9,864         34         59        268        110          1         23 |    10,359 
         3 |       313          1          3         69         13         27          1 |       427 
-----------+-----------------------------------------------------------------------------+----------
     Total |    15,122      1,022        620      2,218        759      1,005      1,204 |    21,950 

20

. 
. matrix ymi=ymi,ymix

. clear

. svmat ymi, names(y)
number of observations will be reset to 1392
Press any key to continue, or Break to abort
obs was 0, now 1392

. ren y21 n

. ren y22 perpe

. ren y23 k

. ren y24 i

. 
. order n perpe k i y1-y20

. save "${data}/${name}", replace
file C:/Users/silvio/Documents/CVR/ryp/data/mult_impu.dta saved

. clear

. capture log close
